package com.test.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class AnimalInvocationHandler implements InvocationHandler {
	
	private Object target;
	
	public AnimalInvocationHandler(Object target) {
		this.target = target;
	}

	@Override
	public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
		System.out.println("###   before invocation");
		Object result = method.invoke(target, args);
		System.out.println("###   end invocation");
		return result;
	}

}
